Pages.FindByPageID method (Publisher) 您所在的位置:网站首页 how to rearrange pages in microsoft publisher Pages.FindByPageID method (Publisher)

Pages.FindByPageID method (Publisher)

2023-04-05 22:38| 来源: 网络整理| 查看: 265

Pages.FindByPageID method (Publisher) Article 09/13/2021 2 minutes to read

Returns a Page object that represents the page with the specified page ID number. Each page is automatically assigned a unique ID number when it is created. Use the PageID property to return a page's ID number.

Syntax

expression.FindByPageID (PageID)

expression A variable that represents a Pages object.

Parameters Name Required/Optional Data type Description PageID Required Long Specifies the ID number of the page that you want to return. Publisher assigns this number when the page is created. Return value

Page

Remarks

Unlike the PageIndex property, the PageID property of a Page object won't change when you add pages to or rearrange pages in the publication. Therefore, using the FindByPageID method with the page ID number can be a more reliable way to return a specific Page object from a Pages collection than using the Item method with the page's index number.

Example

This example demonstrates how to retrieve the unique ID number for a Page object, and then use this number to return that Page object from the Pages collection and add a new shape to the page.

Sub FindPage() Dim lngPageID As Long 'Get page ID lngPageID = ActiveDocument.Pages.Add(Count:=1, After:=1).PageID 'Use page ID to add a new shape to the page ActiveDocument.Pages.FindByPageID(PageID:=lngPageID) _ .Shapes.AddShape Type:=msoShape5pointStar, _ Left:=200, Top:=72, Width:=50, Height:=50 End Sub Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有